Problem with currency formats and big numbers [on hold]
Posted
by
user132750
on Programmers
See other posts from Programmers
or by user132750
Published on 2014-05-28T01:41:33Z
Indexed on
2014/05/28
10:02 UTC
Read the original article
Hit count: 146
c#
I am working on a dollars to euros/euros to dollars converter in C#. I got the formula, $ times 0.73361 = euro, and I have checked Google with the answers. They were right, (1 dollar equals 0.73 euros). However, it stops working properly when the dollar input value is higher than $1363. This is what I get with $1364: $1364 = 1 000,64 €. I don't know what to do, will someone please help me?
Thanks.
decimal toEuro;
Val.doy = "$" + decimal.Parse(richTextBox1.Text); //Ignore this, it's for the output form
CultureInfo eu = new CultureInfo("fr-FR");
toEuro = decimal.Parse(richTextBox1.Text.Trim());
toEuro = toEuro * 0.73361m;
richTextBox1.Clear();
Val.duh = toEuro.ToString("C2", eu);
© Programmers or respective owner